<template>
  <div id="app">
    <!-- 路由占位符 -->
    <router-view></router-view>
  </div>
</template>

<script>

import "./assets/font/iconfont";

export default {
  name: "App",
  methods: {
    unloadHand() {
      let id = this.$store.state.LoginData.userformation[0].id;
      axios({
        method: "post",
        headers: {
          "content-type": "application/x-www-form-urlencoded",
        },
        url: `http://124.71.219.15:8083//management_system/user/logOut?id=${id}`,
      }).then((response) => {
        if (response.data.flag) {
          window.localStorage.clear();
          localStorage.index = 0;
        } else {
          console.log(response.data);
        }
      });
    },
  },
  mounted() {
    window.addEventListener("unload", (e) => this.unloadHand(e));
  },
  destroyed() {
    // 关闭浏览器执行退出接口
    window.removeEventListener("unload");
  },
};
</script>

<style>
/* 设置练级选择器的高度问题，只能写在全局样式中 */
.el-cascader-panel {
  height: 225px;
}

/* html {
  overflow-y: scroll;
} */
</style>
